<?php slot('header')?>
<script type="text/javascript">
$(function(){
	MAIN.setMenu('product');
	$('.slide').nivoSlider();
	$('.hz-video').each(function(){
		var $ob = $(this);
		jwplayer($ob.attr('id')).setup({
        file: $ob.attr('data-video-url'),
        image: $ob.attr('data-photo-url'),
        width: $ob.attr('data-width'),
        height: $ob.attr('data-height')
    });
	});
});
</script>
<?php end_slot()?>
<main>
	<aside class="left">
		<nav class="content">
			<a href="<?php echo url_for2('product')?>"><h1>Sản phẩm</h1></a>
			<ul>
				<?php foreach($data['cates'] as $cate):?>
				<li><a class="<?php echo intval($data['cate_id']) == intval($cate['id'])? '-active': ''?>" href="<?php echo url_for2('product', array('cate_id' => $cate['id']))?>" title="<?php echo $cate['name']?>" alt="<?php echo $cate['name']?>"><h1><?php echo $cate['name']?></h1></a></li>
				<?php endforeach?>
			</ul>
			<div class="clr"></div>
		</nav>
		<div>
			<?php include_component('componentUlti', 'product', array('act' => $data['act'], 'page' => $data['page'], 'cate_id' => $data['cate_id'], 'id' => $data['id']))?>
		</div>
	</aside>
	<aside class="right">
		<div class="bar-title">
			<h1 class="right">Sản phẩm tiêu biểu</h1>
		</div>
		<?php 
		
		foreach($data['products'] as $news):
		$url = url_for2('product_detail', array('id' => $news['id'], 'cate_id' => $news['cate_id'], 'title' => UserStringHelper::titleToAddress($news['name'])));
		?>
		<article class="news-item">
			<a title="<?php echo $news['name']?>" alt="<?php echo $news['name']?>" href="<?php echo $url?>"><h1><?php echo $news['name']?></h1></a>
			<?php if (!empty($news['photo_url'])):?><div class="thumb"><a title="<?php echo $news['name']?>" alt="<?php echo $news['name']?>" href="<?php echo $url?>"><img src="<?php echo $news['photo_url']?>" title="<?php echo $news['name']?>" alt="<?php echo $news['name']?>"/></a></div><?php endif;?>
			<div class="des">
				<?php echo html_entity_decode($news['description'])?>
			</div>
			<div class="pro-order" style="margin-top: 10px"><span class="money-show"><?php echo $news['price']?></span>&#8363;<a class="button right" href="<?php echo $news['href']?>" title="<?php echo $news['name']?>" alt="<?php echo $news['name']?>">Mua hàng</a></div>
		</article>
		<div class="clr"></div>
		
		<?php	endforeach?>
	</aside>
	<div class="clr"></div>
</main>